CREATE TABLE [dbo].[TTINTE_CNTB]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[NU_PROC] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TTINTE_CN__NU_PR__2D27B809] DEFAULT ((0)),
[NU_CNTB_EMPR] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TTINTE_CN__NU_CN__2E1BDC42] DEFAULT ((0)),
[CO_UNID_CNTB] [dbo].[TD_VC_003] NOT NULL,
[CO_OPRC_CNTB] [dbo].[TD_VC_003] NOT NULL,
[NU_ANNO] [dbo].[TD_IN_004_ANOS] NOT NULL CONSTRAINT [DF__TTINTE_CN__NU_AN__2F10007B] DEFAULT (datepart(year,getdate())),
[NU_MESE] [dbo].[TD_IN_002_MESE] NOT NULL,
[NU_ASTO] [dbo].[TD_VC_010] NOT NULL,
[NU_SECU] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TTINTE_CN__NU_SE__31EC6D26] DEFAULT ((0)),
[FE_ASTO_CNTB] [dbo].[TD_DT_001] NULL,
[CO_CNTA_EMPR] [dbo].[TD_VC_020] NULL,
[TI_AUXI_EMPR] [dbo].[TD_VC_001] NULL,
[CO_AUXI_EMPR] [dbo].[TD_VC_020] NULL,
[TI_DOCU] [dbo].[TD_VC_003] NULL,
[NU_DOCU] [dbo].[TD_VC_020] NULL,
[FE_DOCU] [dbo].[TD_DT_001] NULL,
[FE_DOCU_VENC] [dbo].[TD_DT_001] NULL,
[TI_CAMB] [dbo].[TD_VC_003] NULL,
[CO_MONE] [dbo].[TD_VC_003] NULL,
[FA_CAMB] [dbo].[TD_NU_015_006] NULL,
[FA_CAMB_DIAR] [dbo].[TD_NU_015_006] NULL,
[TI_OPER] [dbo].[TD_VC_003] NULL,
[IM_MVTO_ORIG] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TTINTE_CN__IM_MV__32E0915F] DEFAULT ((0)),
[IM_MVTO_CNTB] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TTINTE_CN__IM_MV__33D4B598] DEFAULT ((0)),
[DE_GLOS] [dbo].[TD_VC_100] NULL,
[TI_DOCU_REFE] [dbo].[TD_VC_003] NULL,
[NU_DOCU_REFE] [dbo].[TD_VC_020] NULL,
[FE_DOCU_REFE] [dbo].[TD_DT_001] NULL,
[NO_GIRA] [dbo].[TD_VC_100] NULL,
[FE_ENTR_CHEQ] [dbo].[TD_DT_001] NULL,
[FE_PROG_CHEQ] [dbo].[TD_DT_001] NULL,
[CO_ORDE_SERV] [dbo].[TD_VC_050] NULL,
[SI_MVTO_CNTB] [dbo].[TD_VC_003] NULL,
[SI_MVTO_DOCU] [dbo].[TD_VC_001] NULL,
[CO_UNID_ORIG] [dbo].[TD_VC_003] NULL,
[CO_OPRC_ORIG] [dbo].[TD_VC_003] NULL,
[NU_ASTO_ORIG] [dbo].[TD_VC_010] NULL,
[ST_OTRS] [dbo].[TD_VC_020] NULL,
[NU_PROC_SECU] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTINTE_CN__NU_PR__34C8D9D1] DEFAULT ((0)),
[ST_IMPR_CHEQ] [dbo].[TD_VC_001] NULL,
[ST_FLAG] [dbo].[TD_VC_020] NULL,
[CO_TABL_ORIG] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTINTE_CN__CO_TA__35BCFE0A] DEFAULT ((0)),
[CO_CLAV_TAOR] [dbo].[TD_VC_050] NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NULL,
[ST_CANC_DOCU] [dbo].[TD_VC_001] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTINTE_CN__FE_US__36B12243] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTINTE_CN__FE_US__37A5467C] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTINTE_CNTB] WITH NOCHECK ADD CONSTRAINT [CK__TTINTE_CN__NU_AN__300424B4] CHECK NOT FOR REPLICATION (([NU_ANNO]>(1850)))
GO
ALTER TABLE [dbo].[TTINTE_CNTB] WITH NOCHECK ADD CONSTRAINT [CK__TTINTE_CN__NU_ME__30F848ED] CHECK NOT FOR REPLICATION (([NU_MESE]>=(0) AND [NU_MESE]<=(13)))
GO
ALTER TABLE [dbo].[TTINTE_CNTB] ADD CONSTRAINT [PK__TTINTE_C__90784F914AB81AF0] PRIMARY KEY CLUSTERED  ([CO_EMPR], [NU_PROC], [NU_CNTB_EMPR], [CO_UNID_CNTB], [CO_OPRC_CNTB], [NU_ANNO], [NU_MESE], [NU_ASTO], [NU_SECU]) ON [PRIMARY]
GO
